package cn.fz.luck.saas.config.security.jwt;

import cn.fz.luck.saas.model.SysUser;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

/**
 * @author zhuangqi
 * @date 2017/7/6.
 */
public class JwtUserFactory {

    private JwtUserFactory() {
    }

    public static JwtUser create(SysUser user,Collection<? extends GrantedAuthority> authorities) {
        return new JwtUser(
                user.getUserId(),
                user.getUserName(),
                user.getPassword(),
                user.getEmail(),
                authorities,
                user.getLastLogin()
        );
    }



}
